package main

import "net/http"

// http 包默认提供了5和handler
// 404
// redirect
// strip
// timeout
// file server
func main() {

	// 文件服务
	//http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
	//	http.ServeFile(writer, request, fmt.Sprintf("wwwroot%s",
	//		request.URL.Path))
	//})
	//
	//http.ListenAndServe("localhost:8080", nil)

	// 内置handler, 文件服务
	http.ListenAndServe("localhost:8080",
		http.FileServer(http.Dir("wwwroot")))
}
